<div>
    <nz-card style="border:1px solid #e8e8e8;" [nzBordered]="false" [nzTitle]="titleTemplate" [nzExtra]="extraTemplate">
        <nz-table #basicTable [nzData]="dataSet" #rowSelectionTable nzBordered nzSize="middle" nzShowSizeChanger [nzHideOnSinglePage]="true" [(nzPageIndex)]="pageIndex" [(nzPageSize)]="pageSize" [nzFrontPagination]="false" [nzTotal]="total" (nzPageIndexChange)="searchData()"
            (nzPageSizeChange)="searchData(true)" (nzCurrentPageDataChange)="currentPageDataChange($event)">
            <thead>
                <tr>
                    <th nzShowCheckbox [(nzChecked)]="allChecked" [nzIndeterminate]="indeterminate" (nzCheckedChange)="checkAll($event)"></th>
                    <th>id</th>
                    <th>文章标题</th>
                    <th>文章作者</th>
                    <th>创建时间</th>
                    <th>最后修改时间</th>
                    <th>发布时间</th>
                    <th nzWidth="110px">操作</th>
                </tr>
            </thead>
            <tbody>
                <tr *ngFor="let data of basicTable.data; let i = index">
                    <td nzShowCheckbox [(nzChecked)]="data.checked" (nzCheckedChange)="refreshStatus()"></td>

                    <td>{{data.id}}</td>
                    <td>{{data.title}}</td>
                    <td>{{data.author}}</td>
                    <td>{{data.createTime}}</td>
                    <td>{{data.editTime}}</td>
                    <td>{{data.publishTime}}</td>
                    <td>
                        <button nzTitle="编辑" nzPlacement="top" nz-button nz-tooltip nzType="primary" nzSize="small" nzGhost style="margin-right:10px" (click)="handleEdit(i)">
                            <i class="anticon anticon-edit"></i>
                        </button>
                        <nz-popconfirm [nzTitle]="'确认删除?'" (nzOnConfirm)="deleteRow(data)">
                            <button nzTitle="删除" nzPlacement="top" nz-button nz-tooltip nz-popconfirm nzType="danger" nzSize="small" nzGhost>
                                <i class="anticon anticon-delete"></i>
                            </button>
                        </nz-popconfirm>
                    </td>
                </tr>
            </tbody>
        </nz-table>
    </nz-card>
</div>
<ng-template #extraTemplate>
    <button nz-button nzType="primary" [nzSize]="size" [routerLink]="'/index/publish'">新增<i class="anticon anticon-plus"></i></button>
</ng-template>

<ng-template #titleTemplate>
    <nz-input-group nzSuffixIcon="anticon anticon-search" style="width: 240px;">
        <input type="text" nz-input placeholder="文章标题" [(ngModel)]="searchKey">
    </nz-input-group>
    <button style="margin-left:10px" nz-button nzType="primary" [nzSize]="size" (click)="refresh()">刷新<i nz-icon type="redo" theme="outline"></i></button>
    <button *ngIf="allCheckeds.length" style="margin-left:10px" nz-button nzType="danger" [nzSize]="size" (click)="deleteAll()">批量删除<i nz-icon type="delete" theme="outline"></i></button>
</ng-template>